use crate::src::src::list::{list_nth_data, list_data, list_remove_data, list_iter_has_more, list_nth_entry, list_iter_next, list_sort, list_iterate, list_prev, list_free, list_append, list_length, list_iter_remove, list_to_array, list_next, list_find_data, list_remove_entry, list_prepend};
use crate::src::test::alloc_testing::{alloc_test_set_limit, alloc_test_free};
use crate::src::src::compare_int::{int_compare, int_equal};
use crate::src::test::framework::{run_tests};
use crate::src::struct_and_type::{ListIterator, _ListEntry, ListEqualFunc, ListValue, ListCompareFunc, UnitTestFunction, ListEntry, _ListIterator};
use ::libc;
extern "C" {
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}
#[no_mangle]
pub static mut variable1_test_list: libc::c_int = 50 as libc::c_int;
#[no_mangle]
pub static mut variable2_test_list: libc::c_int = 0;
#[no_mangle]
pub static mut variable3_test_list: libc::c_int = 0;
#[no_mangle]
pub static mut variable4_test_list: libc::c_int = 0;
#[no_mangle]
pub unsafe extern "C" fn generate_list_test_list() -> *mut ListEntry {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    assert!(!(list_append(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(!(list_append(&mut list, &mut variable2_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(!(list_append(&mut list, &mut variable3_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(!(list_append(&mut list, &mut variable4_test_list as *mut libc::c_int as ListValue))
        .is_null());
    return list;
}
#[no_mangle]
pub unsafe extern "C" fn check_list_integrity(mut list: *mut ListEntry) {
    let mut prev: *mut ListEntry = 0 as *mut ListEntry;
    let mut rover: *mut ListEntry = 0 as *mut ListEntry;
    prev = 0 as *mut ListEntry;
    rover = list;
    while !rover.is_null() {
        assert!(list_prev(rover) == prev);
        prev = rover;
        rover = list_next(rover);
    }
}
#[no_mangle]
pub unsafe extern "C" fn test_list_append() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    assert!(!(list_append(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_append(&mut list, &mut variable2_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_append(&mut list, &mut variable3_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_append(&mut list, &mut variable4_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    assert!(list_nth_data(list, 0 as libc::c_int as libc::c_uint)
        == &mut variable1_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 1 as libc::c_int as libc::c_uint)
        == &mut variable2_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 2 as libc::c_int as libc::c_uint)
        == &mut variable3_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 3 as libc::c_int as libc::c_uint)
        == &mut variable4_test_list as *mut libc::c_int as ListValue);
    alloc_test_set_limit(0 as libc::c_int);
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    assert!((list_append(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    check_list_integrity(list);
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_prepend() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    assert!(!(list_prepend(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_prepend(&mut list, &mut variable2_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_prepend(&mut list, &mut variable3_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(!(list_prepend(&mut list, &mut variable4_test_list as *mut libc::c_int as ListValue))
        .is_null());
    check_list_integrity(list);
    assert!(list_nth_data(list, 0 as libc::c_int as libc::c_uint)
        == &mut variable4_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 1 as libc::c_int as libc::c_uint)
        == &mut variable3_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 2 as libc::c_int as libc::c_uint)
        == &mut variable2_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 3 as libc::c_int as libc::c_uint)
        == &mut variable1_test_list as *mut libc::c_int as ListValue);
    alloc_test_set_limit(0 as libc::c_int);
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    assert!((list_prepend(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    check_list_integrity(list);
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_free() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    list_free(list);
    list_free(0 as *mut ListEntry);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_next() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut rover: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    rover = list;
    assert!(list_data(rover) == &mut variable1_test_list as *mut libc::c_int as ListValue);
    rover = list_next(rover);
    assert!(list_data(rover) == &mut variable2_test_list as *mut libc::c_int as ListValue);
    rover = list_next(rover);
    assert!(list_data(rover) == &mut variable3_test_list as *mut libc::c_int as ListValue);
    rover = list_next(rover);
    assert!(list_data(rover) == &mut variable4_test_list as *mut libc::c_int as ListValue);
    rover = list_next(rover);
    assert!(rover.is_null());
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_nth_entry() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut entry: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    entry = list_nth_entry(list, 0 as libc::c_int as libc::c_uint);
    assert!(list_data(entry) == &mut variable1_test_list as *mut libc::c_int as ListValue);
    entry = list_nth_entry(list, 1 as libc::c_int as libc::c_uint);
    assert!(list_data(entry) == &mut variable2_test_list as *mut libc::c_int as ListValue);
    entry = list_nth_entry(list, 2 as libc::c_int as libc::c_uint);
    assert!(list_data(entry) == &mut variable3_test_list as *mut libc::c_int as ListValue);
    entry = list_nth_entry(list, 3 as libc::c_int as libc::c_uint);
    assert!(list_data(entry) == &mut variable4_test_list as *mut libc::c_int as ListValue);
    entry = list_nth_entry(list, 4 as libc::c_int as libc::c_uint);
    assert!(entry.is_null());
    entry = list_nth_entry(list, 400 as libc::c_int as libc::c_uint);
    assert!(entry.is_null());
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_nth_data() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    assert!(list_nth_data(list, 0 as libc::c_int as libc::c_uint)
        == &mut variable1_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 1 as libc::c_int as libc::c_uint)
        == &mut variable2_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 2 as libc::c_int as libc::c_uint)
        == &mut variable3_test_list as *mut libc::c_int as ListValue);
    assert!(list_nth_data(list, 3 as libc::c_int as libc::c_uint)
        == &mut variable4_test_list as *mut libc::c_int as ListValue);
    assert!((list_nth_data(list, 4 as libc::c_int as libc::c_uint)).is_null());
    assert!((list_nth_data(list, 400 as libc::c_int as libc::c_uint)).is_null());
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_length() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    assert!(list_length(list) == 4 as libc::c_int as libc::c_uint);
    assert!(!(list_prepend(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(list_length(list) == 5 as libc::c_int as libc::c_uint);
    list_free(list);
    assert!(list_length(0 as *mut ListEntry) == 0 as libc::c_int as libc::c_uint);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_remove_entry() {
    let mut empty_list: *mut ListEntry = 0 as *mut ListEntry;
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut entry: *mut ListEntry = 0 as *mut ListEntry;
    list = generate_list_test_list();
    entry = list_nth_entry(list, 2 as libc::c_int as libc::c_uint);
    assert!(list_remove_entry(&mut list, entry) != 0 as libc::c_int);
    assert!(list_length(list) == 3 as libc::c_int as libc::c_uint);
    check_list_integrity(list);
    entry = list_nth_entry(list, 0 as libc::c_int as libc::c_uint);
    assert!(list_remove_entry(&mut list, entry) != 0 as libc::c_int);
    assert!(list_length(list) == 2 as libc::c_int as libc::c_uint);
    check_list_integrity(list);
    assert!(list_remove_entry(&mut list, 0 as *mut ListEntry) == 0 as libc::c_int);
    assert!(list_remove_entry(&mut empty_list, 0 as *mut ListEntry) == 0 as libc::c_int);
    list_free(list);
    list = 0 as *mut ListEntry;
    assert!(!(list_append(&mut list, &mut variable1_test_list as *mut libc::c_int as ListValue))
        .is_null());
    assert!(!list.is_null());
    assert!(list_remove_entry(&mut list, list) != 0 as libc::c_int);
    assert!(list.is_null());
    list = generate_list_test_list();
    entry = list_nth_entry(list, 3 as libc::c_int as libc::c_uint);
    assert!(list_remove_entry(&mut list, entry) != 0 as libc::c_int);
    check_list_integrity(list);
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_remove_data() {
    let mut entries: [libc::c_int; 13] = [
        89 as libc::c_int,
        4 as libc::c_int,
        23 as libc::c_int,
        42 as libc::c_int,
        4 as libc::c_int,
        16 as libc::c_int,
        15 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        99 as libc::c_int,
        50 as libc::c_int,
        30 as libc::c_int,
        4 as libc::c_int,
    ];
    let mut num_entries: libc::c_uint = (::core::mem::size_of::<[libc::c_int; 13]>()
        as libc::c_ulong)
        .wrapping_div(::core::mem::size_of::<libc::c_int>() as libc::c_ulong)
        as libc::c_uint;
    let mut val: libc::c_int = 0;
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut i: libc::c_uint = 0;
    list = 0 as *mut ListEntry;
    i = 0 as libc::c_int as libc::c_uint;
    while i < num_entries {
        assert!(!(list_prepend(
            &mut list,
            &mut *entries.as_mut_ptr().offset(i as isize) as *mut libc::c_int
                as ListValue,
        ))
            .is_null());
        i = i.wrapping_add(1);
        i;
    }
    val = 0 as libc::c_int;
    assert!(list_remove_data(
        &mut list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ) == 0 as libc::c_int as libc::c_uint);
    val = 56 as libc::c_int;
    assert!(list_remove_data(
        &mut list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ) == 0 as libc::c_int as libc::c_uint);
    check_list_integrity(list);
    val = 8 as libc::c_int;
    assert!(list_remove_data(
        &mut list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ) == 1 as libc::c_int as libc::c_uint);
    assert!(list_length(list) == num_entries.wrapping_sub(1 as libc::c_int as libc::c_uint));
    check_list_integrity(list);
    val = 4 as libc::c_int;
    assert!(list_remove_data(
        &mut list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ) == 4 as libc::c_int as libc::c_uint);
    assert!(list_length(list) == num_entries.wrapping_sub(5 as libc::c_int as libc::c_uint));
    check_list_integrity(list);
    val = 89 as libc::c_int;
    assert!(list_remove_data(
        &mut list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ) == 1 as libc::c_int as libc::c_uint);
    assert!(list_length(list) == num_entries.wrapping_sub(6 as libc::c_int as libc::c_uint));
    check_list_integrity(list);
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_sort() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut entries: [libc::c_int; 13] = [
        89 as libc::c_int,
        4 as libc::c_int,
        23 as libc::c_int,
        42 as libc::c_int,
        4 as libc::c_int,
        16 as libc::c_int,
        15 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        99 as libc::c_int,
        50 as libc::c_int,
        30 as libc::c_int,
        4 as libc::c_int,
    ];
    let mut sorted: [libc::c_int; 13] = [
        4 as libc::c_int,
        4 as libc::c_int,
        4 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        15 as libc::c_int,
        16 as libc::c_int,
        23 as libc::c_int,
        30 as libc::c_int,
        42 as libc::c_int,
        50 as libc::c_int,
        89 as libc::c_int,
        99 as libc::c_int,
    ];
    let mut num_entries: libc::c_uint = (::core::mem::size_of::<[libc::c_int; 13]>()
        as libc::c_ulong)
        .wrapping_div(::core::mem::size_of::<libc::c_int>() as libc::c_ulong)
        as libc::c_uint;
    let mut i: libc::c_uint = 0;
    list = 0 as *mut ListEntry;
    i = 0 as libc::c_int as libc::c_uint;
    while i < num_entries {
        assert!(!(list_prepend(
            &mut list,
            &mut *entries.as_mut_ptr().offset(i as isize) as *mut libc::c_int
                as ListValue,
        ))
            .is_null());
        i = i.wrapping_add(1);
        i;
    }
    list_sort(
        &mut list,
        Some(
            int_compare
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
    );
    assert!(list_length(list) == num_entries);
    i = 0 as libc::c_int as libc::c_uint;
    while i < num_entries {
        let mut value: *mut libc::c_int = 0 as *mut libc::c_int;
        value = list_nth_data(list, i) as *mut libc::c_int;
        assert!(*value == sorted[i as usize]);
        i = i.wrapping_add(1);
        i;
    }
    list_free(list);
    list = 0 as *mut ListEntry;
    list_sort(
        &mut list,
        Some(
            int_compare
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
    );
    assert!(list.is_null());
}
#[no_mangle]
pub unsafe extern "C" fn test_list_find_data() {
    let mut entries: [libc::c_int; 10] = [
        89 as libc::c_int,
        23 as libc::c_int,
        42 as libc::c_int,
        16 as libc::c_int,
        15 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        99 as libc::c_int,
        50 as libc::c_int,
        30 as libc::c_int,
    ];
    let mut num_entries: libc::c_int = (::core::mem::size_of::<[libc::c_int; 10]>()
        as libc::c_ulong)
        .wrapping_div(::core::mem::size_of::<libc::c_int>() as libc::c_ulong)
        as libc::c_int;
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut result: *mut ListEntry = 0 as *mut ListEntry;
    let mut i: libc::c_int = 0;
    let mut val: libc::c_int = 0;
    let mut data: *mut libc::c_int = 0 as *mut libc::c_int;
    list = 0 as *mut ListEntry;
    i = 0 as libc::c_int;
    while i < num_entries {
        assert!(!(list_append(
            &mut list,
            &mut *entries.as_mut_ptr().offset(i as isize) as *mut libc::c_int
                as ListValue,
        ))
            .is_null());
        i += 1;
        i;
    }
    i = 0 as libc::c_int;
    while i < num_entries {
        val = entries[i as usize];
        result = list_find_data(
            list,
            Some(
                int_equal
                    as unsafe extern "C" fn(
                        *mut libc::c_void,
                        *mut libc::c_void,
                    ) -> libc::c_int,
            ),
            &mut val as *mut libc::c_int as ListValue,
        );
        assert!(!result.is_null());
        data = list_data(result) as *mut libc::c_int;
        assert!(*data == val);
        i += 1;
        i;
    }
    val = 0 as libc::c_int;
    assert!((list_find_data(
        list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ))
        .is_null());
    val = 56 as libc::c_int;
    assert!((list_find_data(
        list,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ListValue,
    ))
        .is_null());
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_to_array() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut array: *mut *mut libc::c_void = 0 as *mut *mut libc::c_void;
    list = generate_list_test_list();
    array = list_to_array(list);
    assert!(*array.offset(0 as libc::c_int as isize)
        == &mut variable1_test_list as *mut libc::c_int as *mut libc::c_void);
    assert!(*array.offset(1 as libc::c_int as isize)
        == &mut variable2_test_list as *mut libc::c_int as *mut libc::c_void);
    assert!(*array.offset(2 as libc::c_int as isize)
        == &mut variable3_test_list as *mut libc::c_int as *mut libc::c_void);
    assert!(*array.offset(3 as libc::c_int as isize)
        == &mut variable4_test_list as *mut libc::c_int as *mut libc::c_void);
    alloc_test_free(array as *mut libc::c_void);
    alloc_test_set_limit(0 as libc::c_int);
    array = list_to_array(list);
    assert!(array.is_null());
    list_free(list);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_iterate() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut iter: ListIterator = ListIterator {
        prev_next: 0 as *mut *mut ListEntry,
        current: 0 as *mut ListEntry,
    };
    let mut i: libc::c_int = 0;
    let mut a: libc::c_int = 0;
    let mut counter: libc::c_int = 0;
    let mut data: *mut libc::c_int = 0 as *mut libc::c_int;
    list = 0 as *mut ListEntry;
    i = 0 as libc::c_int;
    while i < 50 as libc::c_int {
        assert!(!(list_prepend(&mut list, &mut a as *mut libc::c_int as ListValue)).is_null());
        i += 1;
        i;
    }
    counter = 0 as libc::c_int;
    list_iterate(&mut list, &mut iter);
    list_iter_remove(&mut iter);
    while list_iter_has_more(&mut iter) != 0 {
        data = list_iter_next(&mut iter) as *mut libc::c_int;
        counter += 1;
        counter;
        if counter % 2 as libc::c_int == 0 as libc::c_int {
            list_iter_remove(&mut iter);
            list_iter_remove(&mut iter);
        }
    }
    assert!((list_iter_next(&mut iter)).is_null());
    list_iter_remove(&mut iter);
    assert!(counter == 50 as libc::c_int);
    assert!(list_length(list) == 25 as libc::c_int as libc::c_uint);
    list_free(list);
    list = 0 as *mut ListEntry;
    counter = 0 as libc::c_int;
    list_iterate(&mut list, &mut iter);
    while list_iter_has_more(&mut iter) != 0 {
        data = list_iter_next(&mut iter) as *mut libc::c_int;
        counter += 1;
        counter;
    }
    assert!(counter == 0 as libc::c_int);
}
#[no_mangle]
pub unsafe extern "C" fn test_list_iterate_bad_remove() {
    let mut list: *mut ListEntry = 0 as *mut ListEntry;
    let mut iter: ListIterator = ListIterator {
        prev_next: 0 as *mut *mut ListEntry,
        current: 0 as *mut ListEntry,
    };
    let mut values: [libc::c_int; 49] = [0; 49];
    let mut i: libc::c_int = 0;
    let mut val: *mut libc::c_int = 0 as *mut libc::c_int;
    list = 0 as *mut ListEntry;
    i = 0 as libc::c_int;
    while i < 49 as libc::c_int {
        values[i as usize] = i;
        assert!(!(list_prepend(
            &mut list,
            &mut *values.as_mut_ptr().offset(i as isize) as *mut libc::c_int as ListValue,
        ))
            .is_null());
        i += 1;
        i;
    }
    list_iterate(&mut list, &mut iter);
    while list_iter_has_more(&mut iter) != 0 {
        val = list_iter_next(&mut iter) as *mut libc::c_int;
        if *val % 2 as libc::c_int == 0 as libc::c_int {
            assert!(list_remove_data(
                &mut list,
                Some(
                    int_equal
                        as unsafe extern "C" fn(
                            *mut libc::c_void,
                            *mut libc::c_void,
                        ) -> libc::c_int,
                ),
                val as ListValue,
            ) != 0 as libc::c_int as libc::c_uint);
            list_iter_remove(&mut iter);
        }
    }
    list_free(list);
}
static mut tests_test_list: [UnitTestFunction; 15] = unsafe {
    [
        Some(test_list_append as unsafe extern "C" fn() -> ()),
        Some(test_list_prepend as unsafe extern "C" fn() -> ()),
        Some(test_list_free as unsafe extern "C" fn() -> ()),
        Some(test_list_next as unsafe extern "C" fn() -> ()),
        Some(test_list_nth_entry as unsafe extern "C" fn() -> ()),
        Some(test_list_nth_data as unsafe extern "C" fn() -> ()),
        Some(test_list_length as unsafe extern "C" fn() -> ()),
        Some(test_list_remove_entry as unsafe extern "C" fn() -> ()),
        Some(test_list_remove_data as unsafe extern "C" fn() -> ()),
        Some(test_list_sort as unsafe extern "C" fn() -> ()),
        Some(test_list_find_data as unsafe extern "C" fn() -> ()),
        Some(test_list_to_array as unsafe extern "C" fn() -> ()),
        Some(test_list_iterate as unsafe extern "C" fn() -> ()),
        Some(test_list_iterate_bad_remove as unsafe extern "C" fn() -> ()),
        None,
    ]
};
unsafe fn main_0_test_list(
    mut argc: libc::c_int,
    mut argv: *mut *mut libc::c_char,
) -> libc::c_int {
    run_tests(tests_test_list.as_mut_ptr());
    return 0 as libc::c_int;
}
pub fn main_test_list() {
    let mut args: Vec::<*mut libc::c_char> = Vec::new();
    for arg in ::std::env::args() {
        args.push(
            (::std::ffi::CString::new(arg))
                .expect("Failed to convert argument into CString.")
                .into_raw(),
        );
    }
    args.push(::core::ptr::null_mut());
    unsafe {
        ::std::process::exit(
            main_0_test_list(
                (args.len() - 1) as libc::c_int,
                args.as_mut_ptr() as *mut *mut libc::c_char,
            ) as i32,
        )
    }
}
